package SE010;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class createClass
 */
@WebServlet("/createClass")
public class createClass extends HttpServlet{//创建新班级群体
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        String className = request.getParameter("className");//班级名称
        String classBlonger = request.getParameter("classBlonger");//班级创建者,Web会话获取创建者ID，测试阶段自行输入
        Group class1 = new Group(className,classBlonger);
        List<String> IDList = new ArrayList<>();//存储班级群ID
        IDList.add(class1.getInviteID());
        out.print(class1.toString());
    }
}
